//
//  PushViewController.m
//  06-UINavgationController
//
//  Created by 韩旭 on 16/7/21.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "PushViewController.h"

@interface PushViewController ()

@end

@implementation PushViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"da";
    self.view.backgroundColor = [UIColor whiteColor];UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(110, 220, 30, 30)];
    btn.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:btn];
    [btn addTarget:self action:@selector(creatBtn) forControlEvents:UIControlEventTouchUpInside];
}
- (void)creatBtn {
     NSLog(@"%@",self.navigationController.viewControllers);
//    pop 当前ViewController出栈, 返回上一级视图控制器
    [self.navigationController popViewControllerAnimated:YES];
//    返回根视图控制器
    [self.navigationController popToRootViewControllerAnimated:YES];
}
@end
